import request from "@/util/http";

// 获取用户列表
export function getUsers(search = '', page = 1) {
  return request({
    url: '/admin/users',
    method: 'get',
    params: { search, page }
  });
}

// 添加用户
export function addUser(data) {
  return request({
    url: '/admin/users',
    method: 'post',
    data
  });
}

// 更新用户
export function updateUser(userId, data) {
  return request({
    url: `/admin/users/${userId}`,
    method: 'put',
    data
  });
}

// 删除用户
export function deleteUser(userId) {
  return request({
    url: `/admin/users/${userId}`,
    method: 'delete'
  });
}